package com.example.dzbsh.service;

import com.example.dzbsh.dao.DictTuichufangshiMapper;
import com.example.dzbsh.model.DictTuichufangshi;
import com.example.dzbsh.model.DictTuichufangshiExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DictTuichufangshiService {

    @Resource
    DictTuichufangshiMapper ddMapper;

    public List<DictTuichufangshi> findValid(){
        DictTuichufangshiExample mmExample = new DictTuichufangshiExample();
        mmExample.createCriteria().andIsvalidEqualTo(1);
        return ddMapper.selectByExample(mmExample);
    }

    public List<DictTuichufangshi> findByQiyeleixingId(String ppQiyeleixingId){
        DictTuichufangshiExample mmExample = new DictTuichufangshiExample();
        String mmQiyeleixing ="%"+ppQiyeleixingId+"%";
        mmExample.createCriteria().andIsvalidEqualTo(1).andQiyeleixingidLike(mmQiyeleixing);
        return ddMapper.selectByExample(mmExample);
    }

    public DictTuichufangshi findOne(String ppTuichufangshiId){
        return ddMapper.selectByPrimaryKey(ppTuichufangshiId);
    }

}
